package com.design.pattern.abstractFactory.factory;

import com.design.pattern.abstractFactory.bike.Giant;
import com.design.pattern.abstractFactory.bike.Merida;

/**
 * 自行车工厂
 */
public class BikeFactory implements AbstractFactory {

    @Override
    public com.design.pattern.abstractFactory.bike.BikeFactory bikeFactory(String type) {
        return switch (type) {
            case "giant" -> new Giant();
            case "merida" -> new Merida();
            default -> throw new RuntimeException("未找到对应的自行车销售商");
        };
    }
}